<template>
<rx-layout>
    <div  slot="center">
<!-- :dataSource:data => 传入数据源 -->
<!--  ：url ="" =>写接口连接即可获取数据-->
<!-- :multiSelect =>是否可以多选 -->
<!-- ：pageSizeOptions =>展示分页 -->
<!-- defaultPageSize=》默认页面数据10行 -->
<!-- showPage=>是否显示分页 默认显示true-->
<!-- ajaxType=>请求类型默认是post -->
  <rx-grid
     ref="table"
          bordered
          :allowRowSelect="true"
          :multiSelect="true"
          :columns="columns"
          :defaultPageSize="10"
          url="/api-user/user/org/osInstType/query"
          :queryParam="queryParam"
          data-field="result.data"
          :pageSizeOptions="['10','30','40']"
          id-field="typeId"
          @selectChange="onSelectChange"
  >
        <span slot="action" slot-scope="{record }" class="actionIcons">
               <span  @click="alicg(record)">
                   {{i18n('button.rowOfData','获取这行数据')}}
               </span>
               <span  @click="handleEdit(record)">
                   {{$ti18('rxList.editBtn',"编辑")}}
               </span>
        <span  @click="delByIds([record.id])">
            {{$ti18('rxList.delBtn','删除')}}
        </span>
   </span>
  </rx-grid>
    </div>
</rx-layout>
</template>

<script>
import { RxGrid,Util,BaseList} from "@lowcode/jpaas-common-lib"
import Bialog from "./dialog";
export default {
  components: {
    RxGrid
  },
  data() {
    return {
      // 表头数据
      columns: [
        {
          title: this.i18n('form.typeCode', '类型编码'),
          dataIndex: 'typeCode',
          width: 120
        },
        {
          title: this.i18n('form.typeName', '类型名称'),
          dataIndex: 'typeName',
          width: 120
        },
        {
          title: this.i18n('form.enabledOrNot', '是否启用'),
          dataIndex: 'enabled',
          scopedSlots: { customRender: 'enabled' },
          width: 120
        },
        {
          title: this.i18n('form.default', '是否系统缺省'),
          dataIndex: 'isDefault',
          scopedSlots: { customRender: 'isDefault' },
          width: 120
        },
        {
          title: this.i18n('form.homeUrl', '首页URL'),
          dataIndex: 'homeUrl',
          width: 120
        },
        {
          title: this.i18n('form.descp', '描述'),
          dataIndex: 'descp',
          width: 120
        },
        {
          title: this.$ti18('rxList.action', '操作'),
          width: 180,
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' }
        }
      ]
    }
  },
  methods:{
      i18n(name, text, key) {
          return this.$ti18(name, text, "assemblyLang", key);
      },
    alicg:function(record,text){
        console.log(record)
    },
    //编辑调用弹窗组件使用方法一致
    handleEdit(record) {
      Util.open({
        component:Bialog,
        curVm:this,
        widthHeight:['600px','500px'],
        title:this.i18n('form.processingscp', '任务处理'),
        data:{
            record:record
          }
        },function (action){
        console.log(action);
      });
    },
  }
}
</script>

<style scoped>
</style>